﻿<%@ Page Title="停发电调度管理" Language="C#" MasterPageFile="~/Web/Main.Master" AutoEventWireup="true" CodeBehind="PowerDownState.aspx.cs" Inherits="BOMS.WebUI.Web.PowerControl.PowerDownState" %>
<%@ Import Namespace="BOMS.WebUI.Web" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<script type="text/javascript" src="/Js/Dialog.js"></script>
<script type ="text/javascript">
$(document).ready(function () {
    setInterval("startRequest()",<%=Common.RefreshIntev%>);
});
function startRequest() {
    $("#pd").load(location.href + " #pd>*", "" + Math.random() + "");
}
function zOpen(pid) {
    var str=document.getElementById("rdtime"+pid+"").outerText;
    var diag = new Dialog("Diag2");
    diag.Width = 500;
    diag.Height = 270;
    diag.Title = "停发电调度处理";
    diag.URL = "web/PowerControl/PowerControlProcess.aspx?id=" + pid + "&rdt=" + str + "&rdm=" + Math.random();
    diag.OKEvent = callback;    //点击确定后调用的方法
    diag.CancelEvent = callback;
    diag.show();
}
function Open(aid) {
    var diag = new Dialog("Diag2");
    diag.Width = 500;
    diag.Height = 250;
    diag.Title = "停放电调度操作";
    diag.URL = "web/PowerControl/PowerControlProcessAuto.aspx?id=" + aid + "&rdm=" + Math.random();
    diag.OKEvent = callback;    //点击确定后调用的方法
    diag.CancelEvent = callback;
    diag.show();
}
function callback(obj) {
    //debugger;
    if (obj.DialogArguments["returnValue"] == "true") {
    $("#pd").load(location.href + " #pd>*", "" + Math.random() + "");
    } else {
        // do nothing.
    }
}
/*
function CalculateRowTime()
{    
    $("#pd tr[dname=DataRow]").each(function(){
    
        var GrpCapcity =$.trim($("td[dname=dBatGrpCapFree]",this).html());
        var CurI = $.trim($("td[dname=dBatGrpDscI]",this).html());
        var PowerDownTime = $.trim($("td[dname=dPowerDownTime]",this).html());
        //后台方法定义：TimeCalculate(decimal GrpCapcity, decimal CurI, DateTime PowerDownTime)
        var retObj = BOMS.WebUI.Web.PowerControl.PowerDownState.TimeCalculate(GrpCapcity,CurI,PowerDownTime);
        if(retObj&&retObj.value){
            $("td[dname=dPowerDownTime]",this).html(retObj.value);
        }
    })    
}
*/
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<table class="usertableborder" cellspacing="1" cellpadding="3" width="96%" align="center" border="0" id="pd">
    <tr>
        <th colspan="8">系统停发电调度管理</th>
    </tr>
    <tr>
        <td class="usertablerow3" width="15%">基站名称</td>
        <td class="usertablerow3" width="15%">IP地址</td>
        <td class="usertablerow3" width="15%">停电时间</td>
        <td class="usertablerow3" width="10%">电池组容量</td>
        <td class="usertablerow3" width="10%">负载电流</td>
        <td class="usertablerow3" width="10%">剩余放电时长</td>
        <td class="usertablerow3" width="10%">调度操作</td>
        <td class="usertablerow3" width="15%">处理详情</td>
    </tr>
<asp:Repeater runat="server" ID="Repeater1">
    <ItemTemplate>
    <tr class="usertablerow2" dname="DataRow">
        <td align="center"><%#Eval("HostName") %></td>
        <td align="center"><%#Eval("IP") %></td>
        <td align="center" dname="dPowerDownTime"><asp:Literal runat="Server" ID="ltrPowerDownTime" Text='<%#Eval("PowerDownTime") %>'></asp:Literal></td>
        <td align="center" dname="dBatGrpCapFree"><asp:Literal runat="Server" ID="ltrBatGrpCapFree" Text='<%#Eval("BatGrpCapFree")%>'></asp:Literal></td>
        <td align="center" dname="dBatGrpDscI"><asp:Literal runat="Server" ID="ltrBatGrpDscI" Text='<%#Eval("BatGrpDscI")%>'></asp:Literal></td>
        <td align="center" dname="dResDscTime" id="rdtime<%#Eval("ID")%>"><asp:Literal runat="Server" ID="ltrResDscTime" Text='<%#Eval("ResDscTime")%>'></asp:Literal></td>
        <td align="center"><a onclick="javescript:zOpen(<%#Eval("ID")%>)">处理</a></td>
        <td align="center"><div style="display:inline-block;float:left;padding-top:3px;margin-left:10px;"><%#Eval("IsDealwith")%></div><a runat="server" id="lnkView">查看</a></td>
    </tr>
    </ItemTemplate>
</asp:Repeater>
</table>
 
</asp:Content>